Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods / ODCanvas


GetPlatformCanvas

The GetPlatformCanvas method returns the drawing structure for the specified graphics system for this canvas.

ODPlatformCanvas GetPlatformCanvas (in ODGraphicsSystem g);
g
A 16-bit value specifying the graphics system you want to use for this canvas. Valid values for g are platform dependent.
return value
A 32-bit value identifying the graphics-system-specific drawing structure for this canvas. Before using the return value, you must cast it to a valid graphics-system type (such as GrafPtr for QuickDraw or gxViewPort for QuickDraw GX).
DISCUSSION
You call this method to get the graphics-system-specific drawing structure (for instance, a window or view port) when you need to draw into a facet.

On the Mac OS platform, the graphics system may be either QuickDraw (kODQuickDraw) or QuickDraw GX (kODQuickDrawGX). You must specify the graphics system because, on some platforms, a canvas can have drawing structures for two or more graphics systems simultaneously.

If this canvas has a drawing structure for the specified graphics system, this method returns that drawing structure.

On the Mac OS platform, this method generates and returns a drawing structure if the following conditions are all true:

In that situation, this method uses the QuickDraw drawing structure to generate a new QuickDraw GX drawing structure for this canvas.

If this canvas does not have and cannot generate a drawing structure for the specified graphics system, this method returns kODNULL.

EXCEPTIONS
kODErrInvalidGraphicsSystem
This implementation of OpenDoc does not support the specified graphics system, that graphics system is not installed or available, or this canvas has no drawing structure for that graphics system.
SEE ALSO
The ODGraphicsSystem type (page 883).
The ODCanvas::HasPlatformCanvas method (page 74).
The ODCanvas::SetPlatformCanvas method (page 79).
"The Draw Method of Your Part Editor" on page 158 in OpenDoc Programmer's Guide.
"Issues for All Parts" on page 176 in OpenDoc Programmer's Guide.
For more information on graphics-system-specific drawing structures, see the documentation for your graphics system.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help